﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Admin.Common
{
    public interface IRedisFactory<T> where T : class
    {
        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        List<T> Get(string key);
        /// <summary>
        /// 设置缓存
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool Set(string key, object obj);
        /// <summary>
        /// 设置缓存，
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="func">查询条件表达式</param>
        /// <returns></returns>
        bool Set(string key, Expression<Func<T, bool>> func);
    }
}
